<!--
创建问题界面前端文件
author：郦洋
-->


<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- 上述meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>创建问题</title>
      {% load static %}
      <link rel="stylesheet" href="{% static 'bootstrap-4.1.3-dist/css/bootstrap.min.css' %}">
  </head>
  <body>
    <script src="{% static 'jquery/jquery-3.5.0.min.js' %}"></script>
    <script src="{% static 'popper/popper.js' %}"></script>
    <!-- 引入bootstrap的js文件 -->
    <script src="{% static 'bootstrap-4.1.3-dist/js/bootstrap.min.js' %}"></script>
    {% block script %}
        <script>
           $(".django-ckeditor-widget").removeAttr('style');
        </script>
    {% endblock script %}


    <div class="container">
            <div class="col">
              <form class="form-createq" action="/qas_system/createq/" method="post">
                  {% csrf_token %}
                  {% if message %}
                    <div class="alert alert-warning">{{ message }}</div>
                  {% endif %}

                  <h3 class="text-left" style="height: 30px"> </h3>
                  <h3 class="text-center" style="height: 30px">创建新的问题</h3>
                  <div class="form-group">
                    <label>标题：</label>
                    <input type="text" name='question_title' class="form-control"
                           placeholder="为你的问题取一个标题" autofocus required>
                  </div>

                  <div class="form-group">
                    <label>具体描述：</label>
                  </div>

                  <div class="form-group">
                      {{ question_post_form.media }}
                      {{ question_post_form.question_text }}
                  </div>

                  <div class="form-group">
                      <label for="id_subject">科目：</label>
                      <select name="question_subject" >
                      <option value ="请选择">请选择</option>
                        {% for subject in subjects %}
                          <option value ={{ subject }}>{{ subject }}</option>
                        {% endfor %}
                      </select>
                  </div>

                  <div>
                    <button type="submit" class="btn btn-primary float-left">发布问题</button>
                  </div>

              </form>
            </div>
    </div> <!-- /container -->

    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    {#    以下三者的引用顺序是固定的#}
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
    <script src="https://cdn.bootcss.com/popper.js/1.15.0/umd/popper.js"></script>
    <script src="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>

  </body>
</html>